<%@ page language="java" pageEncoding="us-ascii" contentType="text/html;charset=us-ascii" %>
<%--Copyright (C) 2011 Wolfgang Hankeln, Norma J. Wendel
	 
	This file is part of CDinFusion.
	
	CDinFusion is free software: you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public 
	License in version 3 (LGPL3) as published by the Free Software
	Foundation version 3 of the License.
	
	CDinFusion is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	Lesser General Public License for more details.
	
	You should have received a copy of the Lesser General Public
	License along with CDinFusion; see the file COPYING. If not,
	write to the Free Software Foundation, 59 Temple Place - Suite 330,
	Boston, MA 02111-1307, USA or see <http://www.gnu.org/licenses/>.
	
	If you have any questions, send an email to: megx@mpi-bremen.de.
--%>
<%@ page import="org.cdinfusion.data.*"%>
<%@ page import="org.cdinfusion.data.environment.*"%>
<%@ page import="org.cdinfusion.data.studytype.*"%>
<%@ page import="java.util.*"%>

<%
System.out.println("<<<<<<<<<<3_filled_study_input_fields>>>>>>>>>>");
//STUDYTYPE
String study = (String) session.getAttribute("study");
Object obj1 = session.getAttribute("obj1");
String[][] attributes = null;

		if (study.equals("none")){
				out.print("No studytype has been selected.");
				%><input type="hidden" name="study_type" value="none"><%
			}

		if (study.equals("mimarks_s")){
			MIMARKS_S mimarks_s = (MIMARKS_S) obj1;
			attributes = GetInformation.filledFormInformation(mimarks_s);
			%>
			<b>study type: MIMARKS survey (mimarks_s)</b>
			<input type="hidden" name="study_type" value="mimarks_s">
			<%
			}  // end mimarks_s

			if (study.equals("mimarks_c")){
			MIMARKS_C mimarks_c = (MIMARKS_C) obj1;
			attributes = GetInformation.filledFormInformation(mimarks_c);
			%>
			<b>study type: MIMARKS culture (mimarks_c)</b>
			<input type="hidden" name="study_type" value="mimarks_c">
			<%
			} //end mimarks_c

			if (study.equals("eu")){
			EU eu = (EU) obj1;
			attributes = GetInformation.filledFormInformation(eu);
			%>
			<b>study type: MIGS eukaryote (eu)</b>
			<input type="hidden" name="study_type" value="eu">
			<%
			} // end eu

			if (study.equals("ba")){
			BA ba = (BA) obj1;
			attributes = GetInformation.filledFormInformation(ba);
			%>
			<b>study type: MIGS bacteria and archaea (ba)</b>
			<input type="hidden" name="study_type" value="ba">
			<%
			}// end ba

			if (study.equals("pl")){
			PL pl = (PL) obj1;
			attributes = GetInformation.filledFormInformation(pl);
			%>
			<b>study type: MIGS plasmid (pl)</b>
			<input type="hidden" name="study_type" value="pl">
			<%
			}//end pl

			if (study.equals("vi")){
			VI vi = (VI) obj1;
			attributes = GetInformation.filledFormInformation(vi);
			%>
			<b>study type: MIGS virus (vi)</b>
			<input type="hidden" name="study_type" value="vi">
			<%
			} //end vi

			if (study.equals("orga")|study.equals("org")){
			ORG orga = (ORG) obj1;
			attributes = GetInformation.filledFormInformation(orga);
			%>
			
			<b>study type: MIGS organelle (org)</b>
			<input type="hidden" name="study_type" value="org">
			<%
			} //end orga

			if (study.equals("me")){
			ME me = (ME) obj1;
			attributes = GetInformation.filledFormInformation(me);
			%>
			<b>study type: MIMS metagenome (me)</b>
			<input type="hidden" name="study_type" value="me">
			<%
			}// end me
%>
	<table width="100%" border="0" bgcolor="#DCDCDC" cellpadding="1">
		<tr>
		<td align=left style="width:410px"><b><font size=2>parameter</font></b></td>
		<td style="min-width:206px"><b><font size=2></font></b></td>
		<td align=left><b><font size=2>value</font></b></td>
		</tr>
	<%
	try{
		//System.out.println("length: "+attributes.length);
		for(int i = 0; i < attributes.length; i++){%>
			<tr align=left style="min-width:250px"><td><b><font size=1><%=attributes[i][1].toString()%></font></b></td>
			<td align=left style="min-width:206px"><font size=1>
				<a href="popup_information.htm?item=<%=attributes[i][0].toString()%>" target="_blank" onclick="openpopup(this.href); return false"> more info </a>
			</font></td>
	    	<td align=right><input type="text" name="<%=attributes[i][0].toString()%>"  class="required parameter" size="25" value="<%=attributes[i][2].toString()%>"></td></tr>
		<%}
	}catch(Exception e){
		System.out.println("ERROR in 3_filled_study.... "+e.toString()+" ... "+e.getLocalizedMessage());
	}
	%>
	</table>